package com.common.expections;

import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;

public abstract class BaseException extends Exception{
	
	public BaseException(String msg) {
		super(msg);
	}
	
	public BaseException(Throwable throwable) {
		super(throwable);
	}
	
	public BaseException(String msg,Throwable throwable) {
		super(msg,throwable);
	}
	
	/**
	 * 拿输出的栈信息
	 * @param e
	 * @return
	 */
	public static String getStackMsg(Exception e){
		ByteArrayOutputStream bos=new ByteArrayOutputStream();
		PrintWriter pw=new PrintWriter(bos);
		e.printStackTrace(pw);
		pw.flush();
		pw.close();
		return new String(bos.toByteArray());
	}
}
